<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>碳达人</title>

    <link rel="stylesheet" th:href="@{/libs/bootstrapvalidator/css/bootstrapValidator.min.css}"/>
    <link rel="stylesheet" th:href="@{/libs/fireui/accordion.css}"/>
    <link rel="stylesheet" th:href="@{/libs/fireui/table.css}"/>
    <link rel="stylesheet" th:href="@{/cweb/css/calculator.css}"/>
    <link rel="stylesheet" th:href="@{/cweb/css/customer-20211209.css}"/>
</head>
<body>
<header id="header">
    <div th:replace="home/cfragments/navbar :: cnavbar"></div>
</header>
<span th:if="${CURRENT_CUSTOMER == null}">
    <span id="no_login"></span>
</span>
<div class="main-container">
    <div class="content">
        <form class="form-horizontal" id="chemicalForm">
            <div class="calc_two_main" style="min-height: 150px;border:  1px solid #C7C7C7;">
                <div class="calc_table calc_two_main_right_content" style="height: 150px">
                    <div class="table_style1 table_style2 table-responsive">
                        <table class="table table-striped" style="text-align: center;" id="inputTable">


                        </table>
                    </div>
                </div>
                <div class="calc_bottom calc_two_main_right_content">
                    <button class="btn btn-info waves-effect waves-light btn-sm"
                            style="float: right;margin-right: 360px;height: 50px;background: #0480F4;width: 15%;"
                            onclick="getChemicalAll()"
                            type="button">计算
                    </button>
                    <div id="result1"
                         style="float: right;margin-right: -450px;color: #FD7C25;font-size: 50px;font-weight: bolder;line-height: 50px;"></div>
                </div>
            </div>
            <div class="calc_two_main" style="min-height: 830px;border-left:  1px solid #C7C7C7;">
                <div class="calc_two_content calc_two_main_left"
                     style="min-height: 830px;border-right: 1px solid #C7C7C7;border-left: 0;width: 45%">
                    <div id="accordionThree" role="tablist" class="fire_accordion_common fire_accordion1">
                        <div class="card" style="height: 374px">
                            <a data-toggle="collapse" class="title" href="#collapseThree" aria-expanded="true">
                                <i class="fa fa-angle-down"></i>E<sub>燃烧</sub>：燃料燃烧排放量，单位为t
                            </a>
                            <div id="collapseThree" class="collapse in" data-parent="#accordionThree">
                                <div class="card-body" style="line-height:40px">
                                    </br>NCV<sub>j</sub>：第j种化石燃料的平均低位发热量，对固体和液体燃料以GJ/t为单位，对气体燃料以GJ/10<sup>4</sup>Nm<sup>3</sup>为单位
                                    </br>FC<sub>j</sub>：第j种化石燃料的净消耗量，对固体和液体燃料以t为单位，对气体燃料以10<sup>4</sup>Nm<sup>3</sup>为单位
                                    </br>CC<sub>j</sub>：第j种化石燃料的单位热值含碳量，单位为t/GJ
                                    </br>OF<sub>j</sub>：第j种化石燃料的碳氧化率，单位为%
                                </div>
                            </div>
                        </div>
                        <div class="card" style="height: 1875px">
                            <a data-toggle="collapse" class="title" href="#collapse1" aria-expanded="true">
                                <i class="fa fa-angle-down"></i>E<sub>过程,i</sub>：核算单元i的工业生产过程产生的各种温室气体排放总量，单位为t
                            </a>
                            <div id="collapse1" class="collapse in" data-parent="#accordionThree">
                                <div class="card-body" style="line-height:40px">
                                    </br>
                                    AD<sub>i,r</sub>：第i个核算单元的原料r的投入量，对固体和液体燃料以t为单位，对气体燃料以10<sup>4</sup>Nm<sup>3</sup>为单位
                                    </br>
                                    CC<sub>i,r</sub>：第i个核算单元的原料r的含碳量，对固体和液体燃料以tC/t为单位，对气体燃料以tC/10<sup>4</sup>Nm<sup>3</sup>为单位
                                    </br>
                                    AD<sub>i,p</sub>：第i个核算单元的产品p的产量，对固体和液体燃料以t为单位，对气体燃料以10<sup>4</sup>Nm<sup>3</sup>为单位
                                    </br>
                                    CC<sub>i,p</sub>：第i个核算单元的产品p的含碳量，对固体和液体燃料以tC/t为单位，对气体燃料以tC/10<sup>4</sup>Nm<sup>3</sup>为单位
                                    </br>AD<sub>i,w</sub>：第i个核算单元的其他含碳输出物w的产量，单位为t
                                    </br>CC<sub>i,w</sub>：第i个核算单元的其他含碳输出物w的含碳量，单位为tC/t
                                    </br>AD<sub>i,j</sub>：第i个核算单元的碳酸盐j用于原料、助溶剂、脱硫剂等的总消耗量，单位为t
                                    </br>EF<sub>i,j</sub>：第i个核算单元的碳酸盐j的二氧化碳排放因子，单位为tCO<sup>2</sup>/t
                                    </br>PUR<sub>i,j</sub>：第i个核算单元的碳酸盐j以质量分数表示的纯度，单位为%
                                    </br>AD<sub>i,j</sub>：第i个核算单元的生产技术类型j的硝酸产量，单位为t
                                    </br>EF<sub>i,j</sub>：第i个核算单元的生产技术类型j的氧化亚氮生成因子，单位为kgN<sup>2</sup>O/tHNO<sup>3</sup>
                                    </br>η<sub>i,k</sub>：第i个核算单元的尾气处理设备k的氧化亚氮去除效率，单位为%
                                    </br>μ<sub>i,k</sub>：第i个核算单元的尾气处理设备k的使用率，等于尾气处理设备运行时间与硝酸生产装置运行时间的比率，单位为%
                                    </br>AD<sub>i,j</sub>：第i个核算单元的生产技术类型j的己二酸产量，单位为t
                                    </br>
                                    EF<sub>i,j</sub>：第i个核算单元的生产技术类型j的氧化亚氮生成因子，单位为kgN<sup>2</sup>O/tC<sup>6</sup>H<sup>10</sup>O<sup>4</sup>
                                    </br>η<sub>i,k</sub>：第i个核算单元的尾气处理设备k的氧化亚氮去除效率，单位为%
                                    </br>μ<sub>i,k</sub>：第i个核算单元的尾气处理设备k的使用率，等于尾气处理设备运行时间与己二酸生产装置运行时间的比率，单位为%
                                </div>
                            </div>
                        </div>
                        <div class="card" style="height: 175px">
                            <a data-toggle="collapse" class="title" href="#collapse2" aria-expanded="true">
                                <i class="fa fa-angle-down"></i>R<sub>CO2回收,i</sub>：核算单元i的回收且外供的二氧化碳量，单位为t
                            </a>
                            <div id="collapse2" class="collapse in" data-parent="#accordionThree">
                                <div class="card-body" style="line-height:40px">
                                    Q<sub>i</sub>：第i个核算单元回收且外供的二氧化碳气体体积，单位为10<sup>4</sup>Nm<sup>3</sup>
                                    </br>PUR<sub>CO2，i</sub>：第i个核算单元的二氧化碳外供气体的纯度，单位为%
                                </div>
                            </div>
                        </div>
                        <div class="card" style="height: 375px">
                            <div id="collapse4" class="collapse in" data-parent="#accordionThree">
                                <div class="card-body" style="line-height:40px">
                                    </br>AD<sub>购入电</sub>：年度内的外购电力，单位为MWh
                                    </br>EF<sub>购入电</sub>：区域电网年平均供电因子，单位为t/MWh
                                    </br>AD<sub>购入热</sub>：年度内的外购热力，单位为GJ
                                    </br>AD<sub>输出电</sub>：年度内的输出电量，单位为MWh
                                    </br>EF<sub>输出电</sub>：年度内的输出电量，单位为MWh
                                    </br>AD<sub>输出热</sub>：年度内的输出热力，单位为GJ
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="calc_two_content calc_two_main_right" style="min-height: 830px;border-left: 0;width: 55%">
                    <div class="calc_top calc_two_main_right_content">
                        <div class="form-group">
                            <div class="col-sm-1">
                            </div>
                            <div class="col-sm-7">
                                <input type="text" class="form-control" name="eBurn" readonly id="eBurn"
                                       placeholder="燃料燃烧排放量">
                            </div>
                        </div>
                    </div>
                    <div class="calc_table calc_two_main_right_content" style="height: 300px">
                        <div class="table_style1 table_style2 table-responsive">
                            <table class="table table-striped" style="text-align: center;">
                                <thead>
                                <tr>
                                    <th style="width: 10%;">
                                        <button type="button" class="btn btn-primary" style="width: 40px;padding: 0"
                                                onclick="addEBurn()">添加
                                        </button>
                                    </th>
                                    <th style="width: 20%">NCV<sub>j</sub></th>
                                    <th style="width: 20%">FC<sub>j</sub></th>
                                    <th style="width: 20%">CC<sub>j</sub></th>
                                    <th style="width: 30%">OF<sub>j</sub></th>
                                </tr>
                                </thead>
                                <tbody id="eBurnTbody">

                                </tbody>
                            </table>
                        </div>
                    </div>

                    <div class="calc_top calc_two_main_right_content">
                        <div class="form-group">
                            <div class="col-sm-1">
                            </div>
                            <div class="col-sm-7">
                                <input type="text" class="form-control" name="eProcess" readonly id="eProcess"
                                       placeholder="过程排放量">
                            </div>
                        </div>
                    </div>
                    <div class="calc_table calc_two_main_right_content" style="height: 300px">
                        <div class="table_style1 table_style2 table-responsive">
                            <table class="table table-striped" style="text-align: center;">
                                <thead>
                                <tr>
                                    <th style="width: 10%;">
                                        <button type="button" class="btn btn-primary" style="width: 40px;padding: 0"
                                                onclick="addAdir()">添加
                                        </button>
                                    </th>
                                    <th style="width: 45%">AD<sub>i,r</sub></th>
                                    <th style="width: 45%">CC<sub>i,r</sub></th>
                                </tr>
                                </thead>
                                <tbody id="adirTbody">

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="calc_table calc_two_main_right_content" style="height: 300px">
                        <div class="table_style1 table_style2 table-responsive">
                            <table class="table table-striped" style="text-align: center;">
                                <thead>
                                <tr>
                                    <th style="width: 10%;">
                                        <button type="button" class="btn btn-primary" style="width: 40px;padding: 0"
                                                onclick="addAdip()">添加
                                        </button>
                                    </th>
                                    <th style="width: 45%">AD<sub>i,p</sub></th>
                                    <th style="width: 45%">CC<sub>i,p</sub></th>
                                </tr>
                                </thead>
                                <tbody id="adipTbody">

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="calc_table calc_two_main_right_content" style="height: 300px">
                        <div class="table_style1 table_style2 table-responsive">
                            <table class="table table-striped" style="text-align: center;">
                                <thead>
                                <tr>
                                    <th style="width: 10%;">
                                        <button type="button" class="btn btn-primary" style="width: 40px;padding: 0"
                                                onclick="addAdiw()">添加
                                        </button>
                                    </th>
                                    <th style="width: 45%">AD<sub>i,w</sub></th>
                                    <th style="width: 45%">CC<sub>i,w</sub></th>
                                </tr>
                                </thead>
                                <tbody id="adiwTbody">

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="calc_table calc_two_main_right_content" style="height: 300px">
                        <div class="table_style1 table_style2 table-responsive">
                            <table class="table table-striped" style="text-align: center;">
                                <thead>
                                <tr>
                                    <th style="width: 10%;">
                                        <button type="button" class="btn btn-primary" style="width: 40px;padding: 0"
                                                onclick="addAdij()">添加
                                        </button>
                                    </th>
                                    <th style="width: 30%">AD<sub>i,j</sub></th>
                                    <th style="width: 30%">EF<sub>i,j</sub></th>
                                    <th style="width: 30%">PUR<sub>i,j</sub></th>
                                </tr>
                                </thead>
                                <tbody id="adijTbody">

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="calc_table calc_two_main_right_content" style="height: 300px">
                        <div class="table_style1 table_style2 table-responsive">
                            <table class="table table-striped" style="text-align: center;">
                                <thead>
                                <tr>
                                    <th style="width: 10%;">
                                        <button type="button" class="btn btn-primary" style="width: 40px;padding: 0"
                                                onclick="addAdk()">添加
                                        </button>
                                    </th>
                                    <th style="width: 22.5%">AD<sub>i,j</sub></th>
                                    <th style="width: 22.5%">EF<sub>i,j</sub></th>
                                    <th style="width: 22.5%">η<sub>i,k</sub></th>
                                    <th style="width: 22.5%">μ<sub>i,k</sub></th>
                                </tr>
                                </thead>
                                <tbody id="adkTbody">

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="calc_table calc_two_main_right_content" style="height: 300px">
                        <div class="table_style1 table_style2 table-responsive">
                            <table class="table table-striped" style="text-align: center;">
                                <thead>
                                <tr>
                                    <th style="width: 10%;">
                                        <button type="button" class="btn btn-primary" style="width: 40px;padding: 0"
                                                onclick="addAdk2()">添加
                                        </button>
                                    </th>
                                    <th style="width: 22.5%">AD<sub>i,j</sub></th>
                                    <th style="width: 22.5%">EF<sub>i,j</sub></th>
                                    <th style="width: 22.5%">η<sub>i,k</sub></th>
                                    <th style="width: 22.5%">μ<sub>i,k</sub></th>
                                </tr>
                                </thead>
                                <tbody id="adk2Tbody">

                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="calc_center calc_two_main_right_content"
                         style="border-bottom: 1px solid #C7C7C7;height: 175px">
                        <div class="form-group">
                            <label for="qi" class="col-sm-2 control-label"
                                   style="font-size: 17px">Q<sub>i</sub></label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="qi" id="qi">
                            </div>
                            <label for="purco2" class="col-sm-2 control-label"
                                   style="font-size: 17px">PUR<sub>co2，i</sub></label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="purco2" id="purco2">
                            </div>
                        </div>

                    </div>
                    <div class="calc_center calc_two_main_right_content">
                        <div class="form-group">
                            <label for="adPurchaseElectric" class="col-sm-2 control-label"
                                   style="font-size: 17px">AD<sub>购入电</sub></label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="adPurchaseElectric"
                                       id="adPurchaseElectric">
                            </div>
                            <label for="efPurchaseElectric" class="col-sm-2 control-label"
                                   style="font-size: 17px">EF<sub>购入电</sub></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="efPurchaseElectric" id="efPurchaseElectric">
                                    <option value="0">请选择</option>
                                    <option value="0.9419">0.9419(华北电网)</option>
                                    <option value="1.0826">1.0826(东北电网)</option>
                                    <option value="0.7921">0.7921(华东电网)</option>
                                    <option value="0.8587">0.8587(华中电网)</option>
                                    <option value="0.8922">0.8922(西北电网)</option>
                                    <option value="0.8042">0.8042(南方电网)</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="adOutInputElectric" class="col-sm-2 control-label"
                                   style="font-size: 17px">AD<sub>输出电</sub></label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="adOutInputElectric"
                                       id="adOutInputElectric">
                            </div>
                            <label for="efOutInputElectric" class="col-sm-2 control-label"
                                   style="font-size: 17px">EF<sub>输出电</sub></label>
                            <div class="col-sm-4">
                                <select class="form-control" name="efOutInputElectric" id="efOutInputElectric">
                                    <option value="0">请选择</option>
                                    <option value="0.9419">0.9419(华北电网)</option>
                                    <option value="1.0826">1.0826(东北电网)</option>
                                    <option value="0.7921">0.7921(华东电网)</option>
                                    <option value="0.8587">0.8587(华中电网)</option>
                                    <option value="0.8922">0.8922(西北电网)</option>
                                    <option value="0.8042">0.8042(南方电网)</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="adPurchaseHeat" class="col-sm-2 control-label"
                                   style="font-size: 17px">AD<sub>购入热</sub></label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="adPurchaseHeat" id="adPurchaseHeat">
                            </div>
                            <label for="adOutInputHeat" class="col-sm-2 control-label"
                                   style="font-size: 17px">AD<sub>输出热</sub></label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control" name="adOutInputHeat" id="adOutInputHeat">
                            </div>
                        </div>
                    </div>
                    <div style="width: 100%; float: left">
                        <div class="calc_line"></div>
                    </div>
                    <div class="calc_bottom calc_two_main_right_content">
                        <button class="btn btn-info waves-effect waves-light btn-sm" style="float: left"
                                onclick="getChemical()"
                                type="button">计算
                        </button>
                        <div id="result"></div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<input type="hidden" id="ids" name="ids">
<div>
    <div th:replace="home/cfragments/float_right :: cfloatright"></div>
</div>
<div class="footer">
    <div th:replace="home/cfragments/footer :: cfooter"></div>
</div>
<script th:src="@{/libs/bootstrap/bootstrap.min.js}"></script>
<script th:src="@{/libs/bootstrapvalidator/js/bootstrapValidator.js}"></script>
<script>

    $(function () {
        $('#tdr').addClass('th-bg');
        if ($('#no_login').length == 1) {
            userLogin();
        }
        initValidator();
    });

    function resetValidator() {
        $("#chemicalForm").data('bootstrapValidator').destroy();
        $('#chemicalForm').data('bootstrapValidator', null);
        initValidator();
    }

    function initValidator() {
        $('#chemicalForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                qi: {
                    message: '核算单元回收且外供的二氧化碳气体体积验证失败',
                    validators: {
                        notEmpty: {
                            message: '请输入核算单元回收且外供的二氧化碳气体体积'
                        },
                        regexp: {
                            regexp: /^[0-9]+\.[0-9]{2}$/,
                            message: '只能输入保留两位小数的数字'
                        }
                    }
                },
                adPurchaseElectric: {
                    message: 'AD<sub>购入电</sub>验证失败',
                    validators: {
                        notEmpty: {
                            message: '请输入AD<sub>购入电</sub>'
                        },
                        regexp: {
                            regexp: /^[0-9]+\.[0-9]{3}$/,
                            message: '只能输入保留三位小数的数字'
                        }
                    }
                },
                adOutInputElectric: {
                    message: 'AD<sub>输出电</sub>验证失败',
                    validators: {
                        notEmpty: {
                            message: '请输入AD<sub>输出电</sub>'
                        },
                        regexp: {
                            regexp: /^[0-9]+\.[0-9]{3}$/,
                            message: '只能输入保留三位小数的数字'
                        }
                    }
                },
                adPurchaseHeat: {
                    message: 'AD<sub>购入热</sub>验证失败',
                    validators: {
                        notEmpty: {
                            message: '请输入AD<sub>购入热</sub>'
                        },
                        regexp: {
                            regexp: /^[0-9]+\.[0-9]{2}$/,
                            message: '只能输入保留两位小数的数字'
                        }
                    }
                },
                adOutInputHeat: {
                    message: 'AD<sub>输出热</sub>验证失败',
                    validators: {
                        notEmpty: {
                            message: '请输入AD<sub>输出热</sub>'
                        },
                        regexp: {
                            regexp: /^[0-9]+\.[0-9]{2}$/,
                            message: '只能输入保留两位小数的数字'
                        }
                    }
                },
                carbonatePurijs: {
                    message: 'PUR<sub>i,j</sub>验证失败',
                    validators: {
                        callback: xz0_1_validator
                    }
                },
                nitricAcidNitrousOxideRatios: {
                    message: 'μ<sub>i,k</sub>验证失败',
                    validators: {
                        callback: xz0_1_validator
                    }
                },
                adipicAcidNitrousOxideRatios: {
                    message: 'μ<sub>i,k</sub>验证失败',
                    validators: {
                        callback: xz0_1_validator
                    }
                },
                purco2: {
                    message: 'PUR<sub>co2，i</sub>验证失败',
                    validators: {
                        callback: xz0_1_validator
                    }
                }

            }
        });
    }

    function addEBurn() {
        let delTd = '<td></td>';
        let td1 = '<td><input type="text" class="form-control" name="ncv" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td2 = '<td><input type="text" class="form-control" name="fc" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td3 = '<td><input type="text" class="form-control" name="cc" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let ofTd = '<td colspan="1">' +
                '<select class="form-control" name="of">' +
                '<option value="0">请选择</option>' +
                '<option value="0.90">0.90(型煤或其他洗煤)</option>' +
                '<option value="0.93">0.93(焦炭、烟煤、洗精煤)</option>' +
                '<option value="0.94">0.94(无烟煤)</option>' +
                '<option value="0.96">0.96(褐煤)</option>' +
                '<option value="0.98">0.98(液体燃料)</option>' +
                '<option value="0.99">0.99(炼厂干气)</option>' +
                '<option value="0.99">0.99(气体燃料)</option>' +
                '</select></td>';
        $('#eBurnTbody').append('<tr>' + delTd + '' + td1 + '' + td2 + '' + td3 + '' + ofTd + '</tr>');
    }

    function addAdir() {
        let delTd = '<td></td>';
        let td1 = '<td><input type="text" class="form-control" name="adirs" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td2 = '<td><input type="text" class="form-control" name="ccirs" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        $('#adirTbody').append('<tr>' + delTd + '' + td1 + '' + td2 + '</tr>');
    }

    function addAdiw() {
        let delTd = '<td></td>';
        let td1 = '<td><input type="text" class="form-control" name="adiws" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td2 = '<td><input type="text" class="form-control" name="cciws" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        $('#adiwTbody').append('<tr>' + delTd + '' + td1 + '' + td2 + '</tr>');
    }

    function addAdip() {
        let delTd = '<td></td>';
        let td1 = '<td><input type="text" class="form-control" name="adips" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td2 = '<td><input type="text" class="form-control" name="ccips" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        $('#adipTbody').append('<tr>' + delTd + '' + td1 + '' + td2 + '</tr>');
    }

    function addAdij() {
        let delTd = '<td></td>';
        let td1 = '<td><input type="text" class="form-control" name="carbonateAdijs" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td2 = '<td><div class="form-group"><input type="text" class="form-control" name="carbonatePurijs"></div></td>';
        let ofTd = '<td colspan="1">' +
                '<select class="form-control" name="carbonateEfijs">' +
                '<option value="0">请选择</option>' +
                '<option value="0.4397">0.4397(碳酸钙)</option>' +
                '<option value="0.5220">0.5220(碳酸镁)</option>' +
                '<option value="0.4149">0.4149(碳酸钠)</option>' +
                '<option value="0.5237">0.5237(碳酸氢钠)</option>' +
                '<option value="0.3799">0.3799(碳酸亚铁)</option>' +
                '<option value="0.3829">0.3829(碳酸锰)</option>' +
                '<option value="0.2230">0.2230(碳酸钡)</option>' +
                '<option value="0.5955">0.5955(碳酸锂)</option>' +
                '<option value="0.3184">0.3184(碳酸钾)</option>' +
                '<option value="0.2980">0.2980(碳酸锶)</option>' +
                '<option value="0.4773">0.4773(碳酸镁钙)</option>' +
                '</select></td>';
        $('#adijTbody').append('<tr>' + delTd + '' + td1 + '' + ofTd + '' + td2 + '</tr>');
        resetValidator();
    }

    function addAdk() {
        let delTd = '<td></td>';
        let td1 = '<td><input type="text" class="form-control" name="nitricAcidAdijs" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td2 = '<td colspan="1">' +
                '<select class="form-control" name="nitricAcidNitrousOxideEfijs">' +
                '<option value="0">请选择</option>' +
                '<option value="13.9">13.9(高压法)</option>' +
                '<option value="11.77">11.77(中压法)</option>' +
                '<option value="9.72">9.72(常压法)</option>' +
                '<option value="8.0">8.0(双加压法)</option>' +
                '<option value="7.5">7.5(综合法)</option>' +
                '</select></td>';
        let td3 = '<td colspan="1">' +
                '<select class="form-control" name="nitricAcidNitrousOxideRemoves">' +
                '<option value="0">请选择</option>' +
                '<option value="0.85">0.85(非选择性催化还原NSCR)</option>' +
                '<option value="0">0(其他)</option>' +
                '</select></td>';
        let td4 = '<td><div class="form-group"><input type="text" class="form-control" name="nitricAcidNitrousOxideRatios"></div></td>';
        $('#adkTbody').append('<tr>' + delTd + '' + td1 + td2 + td3 + td4 + '</tr>');
        resetValidator();
    }

    function addAdk2() {
        let delTd = '<td></td>';
        let td1 = '<td><input type="text" class="form-control" name="adipicAcidAdijs" onkeyup="this.value=this.value.replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/,\'$1$2.$3\')"></td>';
        let td2 = '<td colspan="1">' +
                '<select class="form-control" name="adipicAcidEfijs">' +
                '<option value="0">请选择</option>' +
                '<option value="300">300(硝酸氧化)</option>' +
                '<option value="0">0(其他)</option>' +
                '</select></td>';
        let td3 = '<td colspan="1">' +
                '<select class="form-control" name="adipicAcidNitrousOxideRemoves">' +
                '<option value="0">请选择</option>' +
                '<option value="0.925">0.925(催化去除)</option>' +
                '<option value="0.985">0.985(热去除)</option>' +
                '<option value="0.985">0.985(回收为硝酸)</option>' +
                '<option value="0.94">0.94(回收用作己二酸的原料)</option>' +
                '</select></td>';
        let td4 = '<td><div class="form-group"><input type="text" class="form-control" name="adipicAcidNitrousOxideRatios"></div></td>';
        $('#adk2Tbody').append('<tr>' + delTd + '' + td1 + td2 + td3 + td4 + '</tr>');
        resetValidator();
    }


    function getChemical() {
        let fv = $('#chemicalForm').data('bootstrapValidator');
        fv.validate();
        let flag = fv.isValid();
        if (flag) {
            Core.postAjax("/blog/chemicalindustry/api/result", $('#chemicalForm').serialize(), function (data) {
                console.info(data)
                $('#result').html(data.data.result)
                $('#eBurn').val(data.data.eburn);
                $('#eProcess').val(data.data.eprocess);
                var ids = $('#ids').val();
                $('#ids').val(data.data.id);
                if(ids){
                    $('#ids').val(ids + ',' + data.data.id);
                }
                var arr = new Array();
                var resuall = $('input[name="resuall"]');
                if (resuall.length > 0) {
                    for (var i = 0; i < resuall.length; i++) {
                        arr.push($(resuall[i]).val());
                    }
                }
                arr.push(data.data.result);
                var html = '';
                for (var i = 0; i < arr.length; i++) {
                    if (i == 0) {
                        html += '<tr>';
                    }
                    if (i != 0 && i % 6 == 0) {
                        html += '</tr><tr>'
                    }
                    html += '<td><input type="text" class="form-control" name="resuall" readonly value="' + arr[i] + '"></td>';
                }
                $('#inputTable').html(html)

            });
        }
    }
    
    function getChemicalAll() {
        var result = '';
        var resuall = $('input[name="resuall"]');
        if (resuall.length > 0) {
            for (var i = 0; i < resuall.length; i++) {
                result += $(resuall[i]).val() + '@';
            }
        }
        result = result.substring(0, result.length - 1);
        if (result) {
            var ids = $('#ids').val();
            Core.postAjax("/blog/chemicalindustry/api/resulttwo?result=" + result + '&ids=' + ids, null, function (data) {
                $('#result1').html(data.data.result)
            });
        }
    }
</script>
</body>
</html>